package peer.p2pnet.message;

import java.net.DatagramPacket;

import peer.Message;
import peer.tools.ByteIntSwitch;
import peer.tools.ByteShortSwitch;

public class GetSNodeMessage extends Message{
	public short sType=peer.tools.MessageType.sType_GetSNodeMessage;
	int sessionId =0;
	byte[] dpData=new byte[8];
	public GetSNodeMessage(){
		ByteShortSwitch.toByteArray(ver, dpData, 0);  //add: ver
		ByteShortSwitch.toByteArray(sType, dpData, 2);  //add: service type
		ByteIntSwitch.toByteArray(sessionId, dpData, 4);  //add: sessionId
		dp=new DatagramPacket(dpData,dpData.length);
	}
	public void setSessionId(int sessionId){
		this.sessionId=sessionId;
		ByteIntSwitch.toByteArray(this.sessionId, dpData, 4);  //add: sessionId
	}
	
	public int getSessionId (){
		return sessionId ;
	}
}
